'use strict';

const Controller = require('egg').Controller;

class UserApiController extends Controller {
    
    async getFactoryInfo(){
        const ctx = this.ctx;
        const id = ctx.request.body.id;
        console.log(ctx.request.body);

        ctx.body= {
            "code": 0,
            "msg": {
                "zh": "成功"
            },
            "result": {
                "info": {
                    "qrcode": "/public/test/kksc/chaxun.png",
                    "wx_qrcode": "/public/test/kksc/chaxun.png",
                    "company_name": "    ",
                    "company_en_name": null,
                    "company_address": "   ",
                    "background": "/public/test/kksc/chaxun.png",
                    "introduction": "测试 数据！！！！！！！！！！！！！",
                    "fax": "     ",
                    "phone": "      ",
                    "company_mobile": null,
                    "email": "158538535@qq.com",
                    "website": "www.baidu.com",
                    "icon": "/public/test/kksc/chaxun.png",
                    "signature": "测试数据",
                    "support_tel": "13726648009",
                    "homepage": "",
                    "home": "home",
                    "close_mini_program": "1",
                    "watermark": "/public/test/kksc/chaxun.png",
                    "close_watermark": "1",
                    "close_cut": "1",
                    "module": [
                        {
                            "id": "270",
                            "title": "智能工具",
                            "music": "",
                            "share_icon": "",
                            "share_content": "",
                            "sort": "1",
                            "pic": "",
                            "info": [],
                            "children": [
                                {
                                    "id": "271",
                                    "title": "功能待定",
                                    "music": "",
                                    "share_icon": "/public/test/kksc/chaxun.png",
                                    "share_content": "分享给你",
                                    "sort": "1",
                                    "pic": "/public/test/kksc/chaxun.png",
                                    "info": [
                                        {
                                            "zindex": "1",
                                            "attr": {
                                                "x": 1,
                                                "y": 1
                                            },
                                            "info_type": "2",
                                            "info_content": "[{\"type\":\"img\",\"attr\":{\"x\":-4.266666666666667,\"y\":-8.533333333333333,\"width\":1928.5333333333333,\"height\":3318.4333333333334},\"title\":\"20190808装呗界面-01-01\",\"url\":\"/public/test/kksc/chaxun.png\"}]"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }



    async shareConfig()
    {
        const ctx = this.ctx;
        ctx.body= {
            "code": 0,
            "msg": {
                "zh": "成功"
            },
            "result": [
                {
                    "nonceStr": ")sWFm4Ps9RCTo3qK",
                    "jsapi_ticket": "HoagFKDcsGMVCIY2vOjf9jTfSC2dVotOsGf6SzrE9yZduyanY08YWc0LPESuAqyNoWlRNSIWLPjODgqV7twqcw",
                    "timestamp": 1620354641,
                    "signature": "d80d2fa673aacfa66274866c4c8de0c1f7755250",
                    "appId": "wx126be21c0de4e84b"
                }
            ]
        }
    }
}

module.exports = UserApiController;
